package com.zzw.hj74;

import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.Scanner;

/**
 * @Project: hw_java
 * @Description: 参数解析
 * @Author: zzw
 */

// 注意类名必须为 Main, 不要有任何 package xxx 信息
public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String[] paramList = in.nextLine().split(" ");
        StringBuilder sb = new StringBuilder();
        // 用列表存储"出现的位置,列表元素个数一定为偶数
        List<Integer> index = new ArrayList<>();
        for (int i = 0; i < paramList.length; i++) {
            char[] chars = paramList[i].toCharArray();
            if (chars[0] == '"') {
                index.add(i);
            }
            if (chars[chars.length - 1] == '"') {
                index.add(i);
            }
        }
        for (int i = 0; i < index.size() - 1; i++) {
            if (Objects.equals(index.get(i), index.get(i + 1))) {
                char[] chars = paramList[index.get(i)].toCharArray();
                chars[0] = ',';
                chars[chars.length - 1] = ',';
                String s = new String(chars);
                paramList[index.get(i)] = s;
            } else {
                char[] chars1 = paramList[index.get(i)].toCharArray();
                chars1[0] = ',';
                String s1 = new String(chars1);
                paramList[index.get(i)] = s1;
                char[] chars2 = paramList[index.get(i + 1)].toCharArray();
                chars2[chars2.length - 1] = ',';
                String s2 = new String(chars2);
                paramList[index.get(i + 1)] = s2;
                StringBuilder sb1 = new StringBuilder();
                for (int k = index.get(i); k <= index.get(i + 1); k++) {
                    if (k != index.get(i + 1)) {
                        sb1.append(paramList[k]).append(" ");
                    } else {
                        sb1.append(paramList[k]);
                    }
                }
                paramList[index.get(i)] = sb1.toString();
                for (int k = index.get(i) + 1; k <= index.get(i + 1); k++) {
                    paramList[k] = ",";
                }
            }
        }
        for (String s : paramList) {
            sb.append(s).append(',');
        }
        //System.out.println(sb);
        // 利用正则表达式，使用一个或多个，将sb转为字符串数组
        String[] resultParam = sb.toString().split(",+");
        System.out.println(resultParam.length);
        for (String s : resultParam) {
            System.out.println(s);
        }
    }
}